package com.zhu.service.base.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Data
@Component
public class MinIoClientConfig {
//    minio:
//    endpoint: http://127.0.0.1:9000 #默认端口9000
//    accesskey: minioadmin #默认用户名
//    secretkey: minioadmin #默认密码
//    bucketName: babiq #桶名


    private String endpoint="http://127.0.0.1:9000";

    private String accesskey="minioadmin";

    private String secretkey="minioadmin";

    /**
     * 注入minio 客户端
     * @return
     */
    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder()
                .endpoint(endpoint)
                .credentials(accesskey, secretkey)
                .build();
    }

}
